import os 
import pathlib
appdata=pathlib.PurePath(os.getenv("APPDATA")).parent

savePath=appdata/"LocalLow/guigugame/guigubahuang/Steam/CacheData"
print(savePath)
def getfilesize(file):
    t=["B","KB","MB","GB","TB"]
    s=os.path.getsize(file)
    n=0
    while(s>1024):
        s=s/1024
        n=n+1
    return "%.2f%s"%(s,t[n])
for dir_path, subpaths, files in os.walk(savePath, True):
    #print(dir_path,"\n",files)
    #print("======")
    for file in files:
        path=pathlib.PurePath(dir_path)/file
        print("===")
        print(path)
        print(getfilesize(path))
        print(path.relative_to(savePath))
        print(pathlib.Path(path.parent).exists())


